#ifndef GAME_H
#define GAME_H

#include "../renderer/renderer.h"
#include "../common/Timer.h"

//玩家
#define MAX_NAME_LEN 100
typedef struct {
	char		name[MAX_NAME_LEN+1];

	int			x, y;   //可以整合成一个rect_t
	int			w, h;

	float		path;	//累计行走路径长度，用于换帧

	float		vel_x, vel_y;
	int			dist_x, dist_y; //目的地

	model_t *	model;
	int			state;
	int			direction;
	int			frame;

	int			health;
	int			mana;
	int			luck;
	int			speed;
} player_t;
#define MAX_PLAYER 12

//游戏世界
typedef struct game_t {
	//map_t * map;

	player_t player[MAX_PLAYER];
	int player_count;

	Timer_t	tick;
} game_t;

void init_game(void);
void release_game(void);

void g_update(void);
void g_pause(void);

void g_decollide_player_map(player_t * p, int stepx, int stepy);

extern game_t game;

#endif /* end of include guard: GAME_H */
